//
//  LLIconButton.swift
//  LaiLang
//
//  Created by David on 2017/2/4.
//  Copyright © 2017年 David. All rights reserved.
//

import UIKit

class LLIconButton: UIButton {
    
    var iconView: UIImageView!
    
    var titleView: UILabel!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        iconView = UIImageView(frame: CGRect(x: 16, y: 0, width: frame.height - 16, height: frame.height - 16))
        iconView.center.y = frame.height/2
        iconView.backgroundColor = UIColor.lightGray
        addSubview(iconView)
        
        titleView = UILabel(frame: CGRect(x: 32 + iconView.frame.height, y: 0, width: frame.width - 32 - iconView.frame.height - 16, height: frame.height))
        titleView.text = "标题"
        addSubview(titleView)
    }
    
    
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */

}
